/*************************************************************************
 * File Name:    Palindrome_Number.cc
 * Author:       zero91
 * Mail:         jianzhang9102@gmail.com
 * Created Time: 2013/11/9 10:15:25
 * 
 * Description:  
 ************************************************************************/

#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>

using namespace std;

class Solution {
public:
    bool isPalindrome(int x)
    {
        if (x < 0) return false;
        
        int right = 0;
        for (int t = x; t > 0; t /= 100) {
            right = right * 10 + x % 10;
            x /= 10;
        }
        if (x < right) x = x * 10 + right % 10;
        return x == right;
    }
};

int
main(int argc, char *argv[])
{
    Solution sol;

    cout << sol.isPalindrome(1874994781) << endl;

    return 0;
}
